const service = (Vue: any) => {
  const tmp = require.context('./', true, /\.ts$/);
  tmp.keys().forEach((item: any) => {
    if (item !== './index.ts' && item !== './export.ts') {
      const tmpKey = item.split('/')
      [item.split('/').length - 1].replace(/_service.ts/g, 'Service');
      Vue.prototype[tmpKey] = tmp(item).default;
    }
  });
};

export default service;
